package com.b8a3.themedemo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatTextView;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class ThemeShowActivity extends Activity implements View.OnClickListener {
    private Button bt_c;

    private TextView activity_tab;
    private AppCompatTextView activity_tab_appcompat;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        int themeId = getIntent().getIntExtra(ThemeModel.THEME_KEY, 0);
        String tab = getIntent().getStringExtra(ThemeModel.ACTIVITY_TAP_KEY);
        if (themeId != 0) {
            setTheme(themeId);
        }
        setContentView(R.layout.theme_activity_main);
        activity_tab = (TextView) findViewById(R.id.activity_tab);
        activity_tab_appcompat = findViewById(R.id.activity_tab_appcompat);
        activity_tab.setText(tab);
        activity_tab_appcompat.setText(tab);

        bt_c = findViewById(R.id.bt_c);
        bt_c.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.bt_c:
                startActivity(new Intent(this, MainActivity.class));
                break;
        }
    }
}
